{% macro render(
  view, docs, udict,
  comment_ref,
  reply_ref,
  comment_post_perm,
  comment_edit_perm,
  comment_edit_self_perm,
  comment_delete_perm,
  comment_delete_self_perm,
  reply_post_perm,
  reply_edit_perm,
  reply_edit_self_perm,
  reply_delete_perm,
  reply_delete_self_perm,
  comment_placeholder = 'Write Your Comment',
  comment_post_op = 'reply',
  comment_edit_op = 'edit_reply',
  comment_post_text = 'Comment',
  comment_edit_text = 'Update',
  reply_post_op = 'tail_reply',
  reply_post_text = 'Reply',
  reply_edit_op = 'edit_tail_reply',
  reply_edit_text = 'Update',
  comment_delete_op = 'delete_reply',
  reply_delete_op = 'delete_tail_reply'
) %}
{% import "components/comments_base.html" as comment_base with context %}
{% import "components/comments_"~view~".html" as comment_impl with context %}
<ul class="dczcomments__list view--{{ view }}">
{% if handler.has_perm(comment_post_perm) %}
  {{ comment_impl.comment(true, handler.user) }}
{% endif %}
{% for doc in docs %}
  {{ comment_impl.comment(false, udict[doc['owner_uid']], doc) }}
{% endfor %}
</ul>
{% endmacro %}
